<?php
header('Content-Type: text/html; charset=utf-8');
error_reporting(0);
session_start();
include_once '../comm/config.php';
include_once '../comm/checkpostandget.php';
include_once 'check.php';
include_once 'page.class.php';
include_once '../comm/wjt.php';
$s=include('../data/status.php');
$status=$s['dh_status'];
$keyword=$_GET['keyword']; 
$page = !($_GET['page'])?'1':intval($_GET['page']);
$pagesize=5;
$page2=($page-1)*$pagesize;

$sql="select a.name,a.fangshi,a.spend,a.spid,b.pic from ".$BIAOTOU."dhdingdan as a,".$BIAOTOU."dhlist as b where a.spid=b.id and a.dduserid='".$_SESSION["dduserid"]."'";
$rs = mysql_query($sql);
$total = mysql_num_rows($rs);	
$sql="select a.name,a.fangshi,a.spend,a.spid,a.tbusername,a.address,a.qq,a.remarks,a.status,b.pic from ".$BIAOTOU."dhdingdan as a,".$BIAOTOU."dhlist as b where a.spid=b.id and a.dduserid='".$_SESSION["dduserid"]."' order by a.id desc limit $page2,$pagesize";
$rs = mysql_query($sql);

$tag="center";
$cur='huan';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>商品兑换中心 - 用户中心</title>

<link href="../template/<?=MOBAN?>/css/style.css" rel="stylesheet" type="text/css" />
<link  href="../template/<?=MOBAN?>/css/layout.css" rel="stylesheet" type="text/css" />
<link  href="../template/<?=MOBAN?>/css/comm.css" rel="stylesheet" type="text/css" />
<link  href="../template/<?=MOBAN?>/css/baobei.css" rel="stylesheet" type="text/css" />

<style type="text/css">
#newPreview{filter: progid: DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);}
#apDiv022{width: 715px;height: 88px;border-bottom-width: 1px;border-bottom-style: dashed;border-bottom-color: #CCCCCC;margin-top: 10px;float: left;}
#apDiv25{width: 70px;height: 70px;padding: 5px;float: left;border: 1px dotted #CCCCCC;margin-bottom: 5px;}
#apDiv066{width: 620px;height: 85px;float: right;}
#apDiv199{height: 40px;line-height: 40px;overflow: hidden;margin-right: 5px;}
</style>
</head>
<?php
$modtag="center";
include("../template/".MOBAN."/header_user.tpl.php");
?>


<div class='layout_body'>

  <div class="uInfoTop">
     <div class="break"><a href="javascript:void();" onclick="javascript:window.history.back();"><img src="../template/<?=MOBAN?>/images/back.gif" width="29" height="30" border="0" /></a></div>
     <div class="username usernamefont"><?=$_SESSION["duoduouser"]?></div>
     <div class="userstate"><a class="ustatefont" href="exit.php">退出</a></div>
  </div>
  <div class="usertopline"></div>

  <div class="clears"></div>
  <div class="CreatL">
    <ul>
      <li><a href="tradelist.php?act=taobao">返米管理</a></li>
      <li><a href="tuiguang_url.php"> 我要推广赚米</a></li>
      <li><a href="baobei.php">我的晒吧</a></li>
      <li class="UserSel"><a href="huan.php">我的兑换</a></li>
    </ul>
  </div>

  <div class="CreatR">
    <ul class="babydetail MarginB10">
      <li class="active"><a>我用米兑换的</a></li>
    </ul>
    <div class="clears"></div>
    <div class=" clears"></div>
    
    <div align="right">
      <!--Item Start 兑换-->
      <?php while ($row = mysql_fetch_array($rs)){?>
      <div class="item">
          <div class="picfm">
            <div class="pic"><a href="../huangou.php?id=<?=$row["spid"]?>" target="_blank"><img src="<?=$row["pic"]?>" width="70" height="70" /></a></div>
          </div>
          <div class="data" style="width:223px">
            <div class="t"><?=$row["name"]?></div>
            <div class="c1" style="220px">收货地址：<?=$row["address"]?></div>
          </div>
          <div class="data" style="width:150px;margin-left:30px;display:inline">
            <div class="c2" style="width:148px">Q&nbsp;&nbsp;Q：<?=$row["qq"]?></div>
            <div class="c1" style="width:148px;margin-top:30px">补充：<?=$row["remarks"]?></div>
          </div>
          <div class="data" style="width:124px">
            <div class="c2" style="width:122px">姓名：<?=$row["tbusername"]?></div>
          </div>
          <div class="data" style="width:140px">
            <div class="c2" style="width:138px">状态：<font style="color:#093"><?=$status[$row["status"]]?></font></div>
            <div class="c1" style="width:138px"><img src="../template/<?=MOBAN?>/images/dh<?=$row['fangshi']?>.gif" /> <?=$row['spend']?></div>
          </div>
        </div>
        <?php }?>
        <!--Item End-->  
     	<div class="megas512"><?php pageft($total,$pagesize,1,1,0,10,"tuiguang.php?keyword=".$keyword);	echo $pagenav;?></div>
    </div>
    <div class="clears"></div>
  </div>
  <div class="clears"></div>
</div>

<div class="lineclear" style="margin-top:50px"></div>
<?php
include("../template/".MOBAN."/footer.tpl.php");
?>
</body>
</html>
